﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace System.Models.Models
{
    /// <summary>
    /// 员工表
    /// </summary>
    [Table("T_Staff")]
    public class Staff:BaseEntity
    {
        /// <summary>
        /// 员工名
        /// </summary>
        [Required, Column(TypeName = "varchar"), StringLength(100)]
        public string StaffName { get; set; }

        /// <summary>
        /// 员工密码
        /// </summary>
        [Required, Column(TypeName = "varchar"), StringLength(100)]
        public string PassWord { get; set; } = "123456";

        /// <summary>
        /// 员工邮箱
        /// </summary>
        [Column(TypeName = "varchar"), StringLength(100)]
        public string Email { get; set; }

        /// <summary>
        /// 员工电话
        /// </summary>
        [Column(TypeName = "varchar"), StringLength(100)]
        public string Iphone { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public bool Sex { get; set; }

        /// <summary>
        /// 角色表外键
        /// </summary>
        [ForeignKey(nameof(FkId))]
        public int DepartmentRoleId { get; set; }
        public DepartmentRole FkId { get; set; }

        /// <summary>
        /// 工资
        /// </summary>
        [Required]
        public double Wages { get; set; } = 3000;
        /// <summary>
        /// 账号状态
        /// </summary>
        [Required]
        public bool LoginState = true;
        /// <summary>
        /// 登录时间
        /// </summary>
        public DateTime? LoginTime { get; set; }

    }
}
